package com.heatingcharge.service.sys;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heatingcharge.dto.SysUserDTO;
import com.heatingcharge.entity.sys.SysUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.heatingcharge.param.SysUserParam;
import com.heatingcharge.security.JwtUser;

import java.util.Set;

/**
 * <p>
 * 后台管理用户  服务类
 * </p>
 *
 * @author devin.jiang
 * @since 2019-06-27
 */
public interface ISysUserService extends IService<SysUser> {

    String login(JwtUser jwtUser);
    /**
     * 通过用户名查找用户
     * @param username
     * @return
     */
    SysUser findByName(String username);

    /**
     * 根据用户ID查询权限
     * @param userId
     * @return
     */
    Set<String> findPermsByUserId(Integer userId);

    /**
     * 根据用户ID查询角色
     * @param userId
     * @return
     */
    Set<String> findRoleIdByUserId(Integer userId);

    IPage<SysUserDTO> getSysUsers(Page page, SysUserDTO sysUserDTO);

    boolean save(SysUserParam sysUserParam);
    boolean update(SysUserParam sysUserParam);
}
